var myapp=angular.module('myapp',[]);
myapp.controller('personal.ctrl',['$scope','$http',function ($scope,$http) {
    $scope.nologin=false;
    $scope.logined=false;
    $scope.Exit=function () {
        $http.get('/user/loginoff')
            .then(function () {
                location.href='index.html';
            });
    };
    $http.get('/user/isLogin')
        .then(function (res) {
            if (res.data.status) {
                var username = res.data.data[0].username;
                $http.post('/user/getuser',{username:username}).then(function (res) {
                    $scope.name=res.data.data[0].name;
                });
                $scope.nologin=false;
                $scope.logined=true;
            } else {
                $scope.nologin=true;
                $scope.logined=false;
            }
        })
}]);